<div id="breadcrumbs">
  <%= link_to 'Index', forums_path %> &gt; <%= forum_crumbs(@topic.forum) %> &gt; <%=h @topic.name %>
  <%= link_to content_tag('small', 'edit topic'), edit_topic_path(@topic) if current_user.can_update_topic? @topic %>
</div>

<% if logged_in? %>
<div class="subscription">
<%= render :partial => 'subscriptions/form', :locals => {:topic => @topic} %>
</div>
<% end %>

<div class="posts">
  <%= render :partial => 'posts/post', :collection => @posts %>
</div>

<% has_pages? do -%>
<div class="pagination">
<%= prev_page 'Prev' %>
<%= all_pages({}, :class => 'page_link') %>
<%= next_page 'Next' %>
</div>
<% end -%>

<% if current_user.can_create_post? Post.new(:topic => @topic) %>
  <div class="button">
    <%= link_to 'Add a Reply', new_post_path(:topic_id => @topic) %>
  </div>

  <h3 align="center">Quick Reply</h3>
  <% form_for :post, :url => posts_path, :html => { :id => 'quickreply' } do |f| %>
    <%= f.hidden_field :topic_id, :value => @topic.id %>
    <p>
      <%= f.text_area :content, :rows => 7 %>
    </p>
    <p>
      <%= submit_tag 'Reply', :name => 'create_button' %>
      <%= submit_tag 'Preview', :name => 'preview_button' %>
    </p>
  <% end %>
<% end %>
